<template>
	<view class="container020">
		<view class="con-flex flex_between">
			<view class="userinfo">
				<image :src="avaurl" mode="aspectFill" class="avatar"></image>
				<view class="r">
					<view class="nickname">
						{{nickname}}<text class="userid">({{userid}})</text>
					</view>
					<view class="pset">
						个人信息 >
					</view>
				</view>
			</view>
			<view class="setbtn">
				<text class="iconfont">&#xe68d;</text>
				<text>设置</text>
			</view>
		</view>
	</view>
</template>

<script>
	import { mapState,mapMutations } from 'vuex'
	var util = require("@/common/utils.js")
	
	export default {
		data() {
			return {
				
			};
		},
		computed: {
		    ...mapState(['userid','nickname','avaurl','hasLogin']),
		},
		onLoad() {
			this.checklogin();
		},
		onShow() {
			this.checklogin();
		},
		methods:{
			checklogin(){
				util.checklogin(this.hasLogin)
			},
		}
	}
</script>

<style lang="less">
page{
	background-image:none;
	background-color: #e2ecf6;
}
.avatar{
	width: 100rpx;
	height: 100rpx;
	border-radius: 50%;
}
.con-flex{
	margin-top: 20rpx;
	align-items: flex-start;
}
.userinfo{
	margin-left: 10rpx;
	display: flex;
	align-items: center;
	.r{
		margin-left: 10rpx;
		.nickname{
			font-size: 30rpx;
		}
		.userid{
			font-size: 22rpx;
		}
		.pset{
			margin-top: 10rpx;
			color: #369;
		}
	}
}	
.setbtn{
	background-color: #0b0863;
	color: #fff;
	padding: 8rpx 16rpx;
	font-size: 22rpx;
	border-radius: 10rpx;
}
</style>
